home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / comm / thor12.zip / UPDATETH < prev   
Text File  |  1994-03-03  |  14KB  |  569 lines

  1. ;*************************************************************************
  2. ;    Title:
  3. ;        Install-Thor
  4. ;*************************************************************************
  5. ;    Description:
  6. ;        Commodore Installer Script for the Thor software
  7. ;*************************************************************************
  8. ;    Author:
  9. ;        ╪yvind Ellefsen
  10. ;*************************************************************************
  11. ;    Still to do:
  12. ;
  13. ;*************************************************************************
  14. ;    History:
  15. ;        4/8-93   - First tries. Ver 00
  16. ;        4/8-93   - Working version. Copying files&stuff.
  17. ;        5/8-93   - Asking for install from disk 
  18. ;        7/8-93   - What's up? New beta.. Shit! 
  19. ;        5/9-93   - Ok. Final effort.. 
  20. ;        21/9-93  - Changes Changes... 
  21. ;        23/9-93  - Removed beta-strings. Polished help-texts. Release Ver.
  22. ;        7/10-93  - Added Reqtools.library install.
  23. ;        10/10-93 - Convert, ChoiceType, User-startup, CheckForThor
  24. ;        12/10-93 - Assign-handling
  25. ;       13/10-93 - Custom ReqTools.library install
  26. ;         14/10-93 - Device/Volume check
  27. ;        1/11-93  - Added some CfgArchivers stuff (some bugs too)
  28. ;        4/11-93  - Removed bugs
  29. ;        5/1-94   - Optimized a little. More BBSTypes.
  30. ;        9/1-94   - Added Hippo types, and convert option.
  31. ;        20/2-94  - Thor files is now packed with lha
  32. ;
  33. ;Changes made by Petter Nilsen:
  34. ;
  35. ;        3/3-94   - Will no longer ask for to convert of the database on a
  36. ;                  first time install.
  37. ;                - Will flush library before running "basemanager"
  38. ;                - Better check for if THOR is already installed.
  39. ;                  (checks for "THOR:libs/bbsread.library" and not 
  40. ;                  "THOR:THOR")
  41. ;                - Uses LhX for un-archiving
  42. ;                - Made all library-names lower case
  43. ;*************************************************************************
  44. ;
  45. ;******************************************************
  46. ;***** SET UP OUR VARIABLES AND OTHER SUCH STUFF ******
  47. ;******************************************************
  48.  
  49. ; some useful variables
  50.     (set true 1)
  51.     (set false 0)
  52.     (set yes true)
  53.     (set no false)
  54.     (set is_a_file 1)
  55.     (set is_a_dir 2)
  56.     (set quote "\"")
  57.     (set newline "\n")
  58.     (set nothing "")
  59.     (set Convert Yes)
  60.  
  61. ; set up our delete options
  62.     (delopts "AskUser" "OkNoDelete" "Force")
  63.  
  64. ; some useful procedures
  65.     ; change userlevel to expert
  66.     (procedure expert_level
  67.         (
  68.             (user 2)
  69.         )
  70.     )
  71.  
  72. ; reset userlevel back to default
  73.     (procedure default_level
  74.         (
  75.             (user default-level)
  76.         )
  77.     )
  78.  
  79. ; store off userlevel
  80.     (procedure save_default_level
  81.         (
  82.             (set default-level @user-level)
  83.         )
  84.     )
  85.  
  86. ; some overused strings
  87. (set omp (cat "One moment please..." newline))
  88.  
  89.  
  90. ; introduce ourselfs to the viewers
  91. (welcome "Welcome to the Thor installer.  This installer uses "
  92.     "the Commodore Amiga Installer.  All of our future Thor releases "
  93.     "will be using this installer and we would like to get any feedback "
  94.     "that might help in improving the installation procedure." newline
  95. )
  96.  
  97.  
  98. ; first reset the user level so that the novice can see whats going on
  99.     (save_default_level)
  100.     (expert_level)
  101.  
  102. ;Make assign to install from
  103.     (makeassign "Thor_Install" "" (safe))
  104.  
  105.  
  106. ;******************
  107. ;** Check Memory **
  108. ;******************
  109.  
  110. (run "Avail flush")
  111.  
  112. (set Running (run "Thor_Install:CheckForLib"))
  113.  
  114. (while (= Running 20)
  115.       ((Message newline "Thor seem to be running, you MUST close it NOW."    
  116.         newline "If you don't, the installation will fail!")
  117.     (run "Avail flush")
  118.     (set Running (run "Thor_Install:CheckForLib")))
  119. )
  120.  
  121. ;************************
  122. ;** Start Installation **
  123. ;************************
  124.  
  125. (if (exists "Thor:libs/bbsread.library" (noreq))
  126. ; Then
  127. (    (set ThorUpdate Yes)
  128.     (set Thor_Dir (expandpath "Thor:"))
  129. )
  130. ; Else
  131. (    (set ThorUpdate No)
  132. )
  133. )
  134.  
  135. (if (exists "BBSData:global.config" (noreq))
  136. ; Then
  137. (    (set BBSDataUpdate Yes)
  138.     (set BBSData_Dir (expandpath "BBSData:"))
  139. )
  140. ; Else
  141. (    (set BBSDataUpdate No)
  142. )
  143. )
  144.  
  145.         
  146. (if (= ThorUpdate Yes)
  147. ;then    
  148.     (if (askbool
  149.             (prompt "Thor seems to be installed on your system already." newline
  150.                 "The program resides in " quote Thor_Dir quote "." newline
  151.                 "Do you want to install Thor over it?")
  152.             (help
  153.                 "The installer has determined that you may already have a "
  154.                 "copy of Thor installed on your system. If this is wrong or "
  155.                 "you want the update installed elsewhere, select NO as an "
  156.                 "answer. Otherwise, select YES."
  157.             )
  158.             (default 1)
  159.         )
  160.     ; Then
  161.         ( 
  162.             (set is_update Yes) 
  163.         )
  164.     ; Else
  165.         ( 
  166.             (set is_update No) 
  167.             (set Thor_Dir 
  168.                 (askdir
  169.                     (prompt "Where would you like Thor installed?"
  170.                     newline "The installer will NOT create a directory")
  171.                     (help @askdir-help)
  172.                     (default "Work:")
  173.                     (newpath)
  174.                 )
  175.             )
  176.             (set Thor_Dir (expandpath Thor_Dir))
  177.             (set user_script (cat user_script (cat "Assign Thor: " quote Thor_dir quote newline)))
  178.         )
  179.     )
  180. ;Else
  181.     ((set Thor_Dir
  182.         (askdir
  183.             (prompt "Where would you like Thor installed?"
  184.             newline "The installer will NOT create a directory")
  185.             (help @askdir-help)
  186.             (default @default-dest)
  187.             (newpath)
  188.         )
  189.     )
  190.     (set Thor_Dir (expandpath Thor_Dir))
  191.     (set user_script (cat "Assign Thor: " quote Thor_dir quote newline))
  192.     )
  193. )
  194.  
  195. ; before we go on lets reset the user's level back to what it was
  196. (default_level)
  197.  
  198. ; verify that the Thor directory exists
  199. (if (<> (exists Thor_Dir) is_a_dir)
  200.     (
  201.         (makedir Thor_Dir
  202.             (prompt
  203.                 "The directory you have selected for Thor does not "
  204.                 "seem to exist.  Do you want us to create it for you?"
  205.             )
  206.             (help @makedir-help)
  207.             (infos)
  208.             (confirm)
  209.         )
  210.         (set Thor_Dir (expandpath Thor_Dir))
  211.         (set user_script (cat "Assign Thor: " quote Thor_dir quote newline))
  212.     )
  213. )
  214.  
  215. (makeassign "Thor" Thor_dir)
  216. (makedir "Thor:Data")
  217.  
  218. ;*************
  219. ;** BBSData **
  220. ;*************
  221.  
  222.  
  223. (default_level)
  224.  
  225.     (if (= BBSDataUpdate Yes)
  226.     ; Then
  227.         (if (askbool
  228.             (prompt "There seems to be a message database installed on your system already."
  229.                 "The database resides in " quote BBSData_Dir quote "." newline
  230.                 "Do you want to use this database further?"
  231.             )
  232.             (help
  233.                 "The installer has determined that you may already have a "
  234.                 "message database installed on your system. If this is wrong or "
  235.                 "you want the database installed elsewhere, select NO as an "
  236.                 "answer. Otherwise, select YES."
  237.             )
  238.             (default 1)
  239.     
  240.             )    
  241.         ; Then
  242.             (
  243.                 (set RunCfgArchivers No)
  244.                 (set ConvertCfg Yes)
  245.             )
  246.         ; Else 
  247.             (
  248.                 (set RunCfgArchivers Yes)
  249.                 (set BBSDataMove Yes)
  250.                 (set is_update No)
  251.                 (set BBSData_Dir 
  252.                     (askdir
  253.                     (prompt "Where would you like the message database installed?"
  254.                         newline "The installer will NOT create a directory")
  255.                     (help @askdir-help)
  256.                     (default "Thor:Data")
  257.                     (newpath)
  258.                     )
  259.                 )
  260.                 (set user_script (cat user_script (cat "Assign BBSData: " quote BBSData_dir quote newline)))
  261.             )
  262.         )
  263.     ; Else
  264.         (
  265.             (set ConvertCfg No)
  266.             (set RunCfgArchivers Yes)
  267.             (set BBSData_Dir (expandpath "Thor:Data"))
  268.             (set user_script (cat user_script (cat "Assign BBSData: " quote BBSData_dir quote newline)))
  269.         )
  270.     )    
  271.  
  272. ;***********************************
  273. ;***** GET FIRST DISK IN HERE ******
  274. ;***********************************
  275.  
  276. ; first copy over the stuff
  277. (working omp "Decompressing and copying Thor files.")
  278.  
  279. ;(run "Thor_Install:unpack.sh" )
  280. (run "Thor_Install:lhx -a x Thor_Install:thor.lha THOR:" )
  281.  
  282. ;******************
  283. ;** User-Startup **
  284. ;******************
  285.  
  286. (save_default_level)
  287. (expert_level)
  288. (if (= is_update Yes)
  289. ;Then 
  290.     (set is_update Yes)
  291. ;else
  292.     (if (= BBSDataMove Yes)
  293.     ;Then
  294.         (
  295.         ; now figure out the addition to the user-startup
  296.  
  297.         ; modify S:User-Startup
  298.         (working omp "Updating S:User-Startup.")
  299.             (startup "Thor"
  300.             (prompt
  301.                 "These instructions need to be added to the \"S:User-Startup\" "
  302.                 "so that your system will be properly configured to use Thor "
  303.                 newline
  304.                 newline
  305.                 user_script
  306.             )
  307.                     (help @startup-help)
  308.                     (command user_script)
  309.             )
  310.         )
  311.     ;Else
  312.         (
  313.         ; now figure out the addition to the user-startup
  314.         ; modify S:User-Startup
  315.         (working omp "Updating S:User-Startup.")
  316.             (startup "Thor"
  317.             (prompt
  318.                 "These instructions need to be added to the \"S:User-Startup\" "
  319.                 "so that your system will be properly configured to use Thor "
  320.                 newline
  321.                 newline
  322.                 user_script)
  323.             (help @startup-help)
  324.             (command user_script)
  325.             
  326.             )
  327.         )
  328.     )
  329. )
  330.  
  331. ;*********************
  332. ;** reqtools.libary **
  333. ;*********************
  334.  
  335. (default_level)
  336. (if(= @user-level 2)
  337. ;then 
  338.     (copylib
  339.         (prompt "Copying ReqTools library")
  340.         (help "This will copy the ReqTools library." newline @copylib-help)
  341.         (source "Thor_Install:reqtools.library")
  342.         (dest "libs:")
  343.         (confirm)
  344.     )
  345.  
  346. ;else
  347.     (copylib
  348.         (prompt "Copying ReqTools library")
  349.         (help "This will copy the ReqTools library." newline @copylib-help)
  350.         (source "Thor_Install:reqtools.library")
  351.         (dest "libs:")
  352.     )
  353. )
  354.  
  355. ;************
  356. ;** CfgBBS **
  357. ;************
  358.  
  359. (default_level)
  360.  
  361.  
  362. (set name
  363.    (askoptions
  364.       (prompt "Choose the BBS Types to install:")
  365.       (help "Choose the BBS Types you are going to use with Thor" newline newline @askchoice-help)
  366.       (choices "ABBS      - Plain ABBS" "MBBS      - Plain MBBS" "ABBS_QWK  - ABBS with QWK support" "MBBS_QWK  - MBBS with QWK support" "HIPPO_ISO - Hippo with ISO charset" "HIPPO_IBN - Hippo with IBN charset") 
  367.       (default 63)
  368.    )
  369. )
  370.  
  371.  
  372. (makeassign "BBSData" BBSData_dir)
  373.  
  374. (if (= RunCfgArchivers Yes)
  375.     (    
  376.         (execute "thor:s/CfgArchivers")
  377.     )
  378. )
  379.  
  380. (if (bitand 1 name)
  381.    (execute "thor:s/CfgAbbs")
  382. )
  383. (if (bitand 2 name)
  384.    (execute "thor:s/CfgMbbs")
  385. )
  386. (if (bitand 4 name)
  387.    (execute "thor:s/CfgAbbs_qwk")
  388. )
  389. (if (bitand 8 name)
  390.    (execute "thor:s/CfgMbbs_qwk")
  391. )
  392. (if (bitand 16 name)
  393.    (execute "thor:s/CfgHippo_ISO")
  394. )
  395. (if (bitand 32 name)
  396.    (execute "thor:s/CfgHippo_IBN")
  397. )
  398.  
  399.  
  400.  
  401.  
  402. (set name
  403.    (askoptions
  404.       (prompt "Choose the BBS Types to install:")
  405.       (help "Choose the BBS Types you are going to use with Thor" newline newline @askchoice-help)
  406.       (choices "QWK     - General QWK" "QWK_ISO - General QWK with ISO charset" "QWK_NO7 - General QWK with NO7 charset" "QWK_DE7 - General QWK with DE7 charset" "QWK_SF7 - General QWK with SF7 charset") 
  407.       (default 31)
  408.    )
  409. )
  410.  
  411. (if (bitand 1 name)
  412.    (execute "thor:s/CfgQwk")
  413. )
  414. (if (bitand 2 name)
  415.    (execute "thor:s/CfgQwk_iso")
  416. )
  417. (if (bitand 4 name)
  418.    (execute "thor:s/CfgQwk_no7")
  419. )
  420. (if (bitand 8 name)
  421.    (execute "thor:s/CfgQwk_de7")
  422. )
  423. (if (bitand 16 name)
  424.    (execute "thor:s/CfgQwk_sf7")
  425. )
  426.  
  427.  
  428. ;*************
  429. ;** Convert **
  430. ;*************
  431.  
  432. (if (= ConvertCfg Yes)
  433. ;Then
  434.     (
  435.         (default_level)
  436.         (if(= @user-level 2)
  437.         ;then 
  438.             (
  439.                 (message newline "The installer will now convert and upgrade the "
  440.                     newline "message database.")
  441.                 (run "Avail flush")
  442.                 (run "Thor:bin/basemanager convert")
  443.             )
  444.     
  445.         ;else
  446.             (
  447.                 (working omp)
  448.                 (run "Avail flush")
  449.                 (run "Thor:bin/basemanager convert")    
  450.             )    
  451.         )
  452.     )
  453. ;Else
  454. ;(Set BBSDataUpdate No)
  455. )
  456.  
  457. ;****************
  458. ;** ConvertCfg **
  459. ;****************
  460.  
  461. (if (= ConvertCfg Yes)
  462. ;Then
  463.     (
  464.         (default_level)
  465.         (if(= @user-level 2)
  466.         ;then 
  467.             (
  468.                 (message newline "The installer will now convert and upgrade the "
  469.                     newline "configuration datafiles for you.")
  470.                 (run "thor:bin/convertConfig convert")
  471.             )
  472.     
  473.         ;else
  474.             (
  475.                 (working omp)
  476.                 (run "thor:bin/convertConfig convert")    
  477.             )    
  478.         )
  479.     )
  480. ;Else
  481. ;(Set ConvertCfg No)
  482. )
  483.  
  484.  
  485. ;***********
  486. ;** Fonts **
  487. ;***********
  488.     
  489. (copyfiles
  490.     (prompt "Choose the fonts to install with Thor" newline "These are not required for Thor to run" )
  491.     (help "This will copy the default font files for Thor." newline @copyfiles-help)
  492.     (source "Thor_Install:Fonts")
  493.     (dest "Fonts:")
  494.     (fonts)
  495.     (choices "Grn" "Thin609" "Thin611" "Thin711")
  496.     (confirm)
  497. )
  498.  
  499.  
  500.  
  501. ;***************
  502. ;** LogReader **
  503. ;***************
  504.  
  505. (if    (askbool
  506.         (prompt newline "Do you want the LogReader software installed?")
  507.         (help newline "The LogReader software is a program for" newline
  508.              "calculating phone-bills from logfiles." newline
  509.             newline "Select YES if you want it installed, otherwise NO")
  510.         (default 1)
  511.     )
  512.     
  513. ; Then
  514.     (copyfiles
  515.         (prompt "Copying LogReader files")
  516.         (help "This will copy the files needed by LogReader." newline @copyfiles-help)
  517.         (source "Thor_Install:LogReader")
  518.         (dest Thor_dir)
  519.         (all)
  520.         (infos)
  521.     )
  522. )
  523.  
  524. ;****************
  525. ;** AmigaGuide **
  526. ;****************
  527.  
  528. (if    (askbool
  529.         (prompt newline "Do you want the AmigaGuide" newline "program and library installed?"
  530.             newline newline "If you have a newer version of the library" newline 
  531.             "on your system, it will NOT be overwritten")
  532.         (help newline "The AmigaGuide library is needed for the Thor documentation"
  533.             newline "and the online help system in Thor."
  534.             newline newline "Select YES if you want it installed, otherwise NO")
  535.         (default 1)
  536.     )
  537. ; Then
  538.     (
  539.         (copyfiles
  540.             (prompt "Copying AmigaGuide program file")
  541.             (help "This will copy the files needed by AmigaGuide." newline @copyfiles-help)
  542.             (source "Thor_Install:AmigaGuide")
  543.             (dest "sys:Utilities")
  544.         )
  545.         (copylib
  546.             (prompt "Copying AmigaGuide library")
  547.             (help "This will copy the AmigaGuide library." newline @copylib-help)
  548.             (source "Thor_Install:amigaguide.library")
  549.             (dest "libs:")
  550.         )
  551.     )
  552. )
  553.  
  554. ;*****************************
  555. ;***** WE ARE ALMOST DONE ****
  556. ;*****************************
  557.  
  558. ; make sure that default-dir is pointing to the right place
  559. (set @default-dest Thor_Dir)
  560.     
  561. (makeassign "Thor_Install")     
  562. (makeassign "Thor_Disk" (safe))
  563.  
  564. ; final message for our viewers
  565.     (set end_text "Now call Ultima Thule BBS for your first message packet.")
  566.  
  567. ; now for the exit
  568.     (exit end_text)
  569.